package com.es.poem.es;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * @description: 唐诗
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "poem")
@Setting(settingPath = "/json/poem/poem_settings.json") //可自定义配置项 ，相当es的_setttings
@Mapping(mappingPath = "/json/poem/poem_mapping.json") //可自定义配置mapping，相当于es 的mappings
public class PoemES {

    @Id
    private Long id;

    @Field(type = FieldType.Text)
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String author;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String content;

}
